package org.whuims.pois.model;

import javax.persistence.*;

/**
 * Created by zhongwei on 2014/5/17.
 */
@Entity
@Table(name = "star")
public class Stare {
    private int id;
    private String user;
    private Long dataid;

    public Stare(String user, Long dataid) {
        this.user = user;
        this.dataid = dataid;
    }

    public Stare() {
    }

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user")
    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    @Basic
    @Column(name = "dataid")
    public Long getDataid() {
        return dataid;
    }

    public void setDataid(Long dataid) {
        this.dataid = dataid;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Stare stare = (Stare) o;

        if (id != stare.id) return false;
        if (dataid != null ? !dataid.equals(stare.dataid) : stare.dataid != null) return false;
        if (user != null ? !user.equals(stare.user) : stare.user != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (user != null ? user.hashCode() : 0);
        result = 31 * result + (dataid != null ? dataid.hashCode() : 0);
        return result;
    }
}
